import React, { Component } from 'react';
import { Form } from 'antd';
import setBright from './SetBright';
import SetPower from './SetPower';
import SetParams from './SetParams';
import SetTest from './SetTest';
import SetPublish from './SetPublish';
import SetReboot from './SetReboot';
import SetWIFI from './SetWIFI';
import QueryHwInfo from './QueryHwInfo';
import OneKeyStart from './OneKeyStart';
import OneKeyPubLish from './OneKeyPubLish';
import DevBind from './DevBind';
import QueryAlarm from './QueryAlarm';
import SetAlarm from './SetAlarm';
import DevOta from './DevOta';
import DevUninstall from './DevUninstall';
import OneKeyPubLishApply from './OneKeyPubLishApply';
export default class OperationForm extends Component {
  getDriver() {
    switch (this.props.opType) {
      case 'setBright': {
        return setBright;
      }
      case 'setPower': {
        return SetPower;
      }
      case 'setParams': {
        return SetParams;
      }
      case 'setTest': {
        return SetTest;
      }
      case 'setPublish': {
        return SetPublish;
      }
      case 'setReboot': {
        return SetReboot;
      }
      case 'setWIFI': {
        return SetWIFI;
      }
      case 'queryHwInfo': {
        return QueryHwInfo;
      }
      case 'oneKeyStart': {
        return OneKeyStart;
      }
      case 'oneKeyPubLish': {
        return OneKeyPubLish;
      }
      case 'devbind': {
        return DevBind;
      }
      case 'queryAlarm': {
        return QueryAlarm;
      }
      case 'setAlarm': {
        return SetAlarm;
      }
      case 'oneKeyPubLishApply': {
        return OneKeyPubLishApply;
      }
      case 'devOta': {
        return DevOta;
      }
      case 'devUninstall': {
        return DevUninstall;
      }
      default: {
        return SetPower;
      }
    }
  }

  render() {
    const Driver = this.getDriver(this.props);
    const CreateForm = Form.create()(Driver);
    return <CreateForm {...this.props} />;
  }
}
